package cn.iocoder.yudao.module.def.dal.mysql.projectprogress;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.def.dal.dataobject.projectprogress.ProjectProgressDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.def.controller.admin.projectprogress.vo.*;

/**
 * 工程进度 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ProjectProgressMapper extends BaseMapperX<ProjectProgressDO> {

    default PageResult<ProjectProgressDO> selectPage(ProjectProgressPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ProjectProgressDO>()
                .eqIfPresent(ProjectProgressDO::getProjectId, reqVO.getProjectId())
                .likeIfPresent(ProjectProgressDO::getProjectName, reqVO.getProjectName())
                .likeIfPresent(ProjectProgressDO::getProjectName, reqVO.getProjectNameAuth())
                .eqIfPresent(ProjectProgressDO::getIsStart, reqVO.getIsStart())
                .eqIfPresent(ProjectProgressDO::getIsFinish, reqVO.getIsFinish())
                .eqIfPresent(ProjectProgressDO::getTotalInvest, reqVO.getTotalInvest())
                .eqIfPresent(ProjectProgressDO::getCompleteInvest, reqVO.getCompleteInvest())
                .eqIfPresent(ProjectProgressDO::getIssueInvest, reqVO.getIssueInvest())
                .eqIfPresent(ProjectProgressDO::getPaidInvest, reqVO.getPaidInvest())
                .eqIfPresent(ProjectProgressDO::getBudgetaryInvestRate, reqVO.getBudgetaryInvestRate())
                .eqIfPresent(ProjectProgressDO::getProjectProgress, reqVO.getProjectProgress())
                .orderByDesc(ProjectProgressDO::getId));
    }
    List<ProjectStatisticsExport> getAnnualStatistics();
}